package team.hnu.house.web.controller;

import java.util.List;

import javax.annotation.Resource;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import team.hnu.house.domain.User;
import team.hnu.house.service.UserService;


@Controller
@RequestMapping("/user")
@Api(value="aaaaaaa",description = "User的相关信息接口")
public class UserController {
	
	@Autowired
	private UserService userService;
	
	@RequestMapping("userlist")
	@ApiOperation(value="获取所有user",notes="获取所有user，无需参数", httpMethod = "POST")
	public String userlist(Model model) {
		List<User> userlist = userService.userlist();
		System.out.println(userlist);
		model.addAttribute("userlist", userlist);
		return "userlist";
	}

}
